Prevent a segfault
authorMatthias Clasen <matthiasc@src.gnome.org>
Fri, 4 Nov 2005 15:56:13 +0000 (15:56 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 4 Nov 2005 15:56:13 +0000 (15:56 +0000)
gtk/xdgmime/ChangeLog
gtk/xdgmime/xdgmime.c

index 5b18a59b903d1f22d555bf969f134b5ebfc724e6..72f58432df93ffc2d91ef9521426fe45ae7a240e 100644 (file)
@@ -1,3 +1,8 @@
+2005-11-04  Matthias Clasen  <mclasen@redhat.com>
+
+       * xdgmime.c (xdg_mime_list_mime_parents): Prevent
+       a segfault.  
+
 2005-10-18  Matthias Clasen  <mclasen@redhat.com>
 
        * xdgmimecache.c: Make magic comparisons work correctly
index 897ef9b385f4cc262c2d5fe8c166b6318d8dd397..55d44b30186d0fdf38b7d96c231e7e0bfcb431ab 100644 (file)
@@ -719,6 +719,10 @@ xdg_mime_list_mime_parents (const char *mime)
     return _xdg_mime_cache_list_mime_parents (mime);
 
   parents = xdg_mime_get_mime_parents (mime);
+
+  if (!parents)
+    return NULL;
+
   for (i = 0; parents[i]; i++) ;
   
   n = (i + 1) * sizeof (char *);